package stu.kurs.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import stu.kurs.Constants;

@Entity
@Table(name = "users")
public class User extends DomainObject{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8155306059847477198L;

	@Column(name = "email", nullable = false, unique = true)
	private String email;
	
	@Column(name = "password", nullable = false)
	private String password;
	
	@Column(name = "level", nullable = false)
	private Integer level;

	

	public User(){
		super();
	}
	
	
	/**
	 * @param email
	 * @param password
	 * @param level
	 */
	public User(String email, String password, Integer level) {
		super();
		this.email = email;
		this.password = password;
		this.level = level;
	}
	
	/**
	 * @param email
	 * @param password
	 */
	public User(String email, String password) {
		super();
		this.email = email;
		this.password = password;
		this.level = Constants.LEVEL_USER_SIMPLE;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the level
	 */
	public Integer getLevel() {
		return level;
	}

	/**
	 * @param level the level to set
	 */
	public void setLevel(Integer level) {
		this.level = level;
	}
	
}